{% block sw_condition_and_container %}
<div
    class="sw-condition-or-container"
    :class="containerRowClass"
>
    {% block sw_condition_or_container_children %}
    <template
        v-for="(child, index) in condition[childAssociationField]"
        :key="`condition-or-container-child--${index}`"
    >
        <div
            v-if="index > 0"
            class="condition-content__spacer--or"
        >
            {{ $tc('global.sw-condition.condition.or') }}
        </div>

        <sw-condition-tree-node
            :parent-condition="condition"
            :condition="child"
            :disabled="disabled || undefined"
            :level="level + 1"
        />
    </template>
    {% endblock %}

    {% block sw_condition_or_container_actions %}
    <div class="sw-condition-or-container__actions">
        <mt-button
            v-tooltip.top="getNoPermissionsTooltip('product_stream.editor')"
            ghost
            size="small"
            class="sw-condition-or-container__actions--or"
            :disabled="disabled"
            variant="primary"
            @click="onAddPlaceholder"
        >
            {{ $tc('global.sw-condition.condition.AddOrCondition') }}
        </mt-button>
        <mt-button
            v-if="level !== 0"
            v-tooltip.top="getNoPermissionsTooltip('product_stream.editor')"
            ghost
            size="small"
            class="sw-condition-or-container__actions--sub"
            :disabled="disabled"
            variant="primary"
            @click="onAddAndContainer"
        >
            {{ $tc('global.sw-condition.condition.AddSubCondition') }}
        </mt-button>

        <mt-button
            v-tooltip.top="getNoPermissionsTooltip('product_stream.editor')"
            size="small"
            class="sw-condition-or-container__actions--delete"
            :disabled="disabled"
            variant="secondary"
            @click="onDeleteAll"
        >
            <span v-if="level !== 0">{{ $tc('global.sw-condition.condition.deleteConditions') }}</span>
            <span v-else>{{ $tc('global.sw-condition.condition.deleteAllConditions') }}</span>
        </mt-button>
    </div>
    {% endblock %}
</div>
{% endblock %}
